package com.cloud.dao;

import com.cloud.dto.TaskDto;
import com.cloud.entity.Task;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import javax.persistence.criteria.CriteriaBuilder;
import java.util.List;

public interface TaskRepository extends JpaRepository<Task,Integer> {

    @Query(value = "select * from task where p_id =?1 order by level",nativeQuery = true)
    public List<Task> findTasksBypId(Integer Pid);

    public List<Task> findTaskByUserId(Integer UserId);

    @Query(value = "select * from task where p_id =?1",nativeQuery = true)
    public List<Task> findTask(Integer Pid);

}
